﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using System.Threading;

namespace JESAI.Redis.Abstracts
{
    public interface IObjectInstancePool<T> : IDisposable
    {
        public Task<T> GetAsync(CancellationToken cancellationToken = default);

        public void Start();

        public void SetCreateNewObjectFunc(Func<Action<T>, CancellationToken, Task<T>> func);

        public void SetGetObjectFunc(Func<CancellationToken, T> func);

        public void SetReturnPreCheckObjIsValidFunc(Func<bool> func);
    }
}
